import API from "API";
import {request as Request} from "Ajax";
import CustomError from "../utils/CustomError";
module.exports = {
    /*
    * 获取分类
    * */
    getCate: async function () {
        try {
            return await Request({
                url: API.newsCate
            })
        } catch (e) {
            throw new CustomError (e, "Viewpoint.getCate").parse()
        }
    },

    /*
    * 获取列表
    * */
    getList: async function (data = {}) {
        try {
            return await Request({
                url: API.newsList,
                data: data
            })
        } catch (e) {
            throw new CustomError (e, "Viewpoint.getList").parse()
        }
    },

    /*
    * 获取详情
    * */
    getDetail: async function (id) {
        try {
            return await Request({
                url: API.newsDetail,
                data: {id: id}
            })
        } catch (e) {
            throw new CustomError (e, "Viewpoint.getDetail").parse()
        }
    },
}